package com.lihan.GetSeatInLib.Domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lihan.GetSeatInLib.Domain.Enums.SeatStaus;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("座位模型")
@Entity
@Table(name = "t_seats")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer"})
public class SeatModel {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty("座位ID")
	@Column(name = "seat_id",length = 20)
	private long ID;
	
	@ApiModelProperty("座位编号：PS像座位号一样，ABCD什么的")
	@Column(name = "seat_index",length = 20)
	private String IndexNum;
	
	@ApiModelProperty("座位状态，在枚举类型里有说明")
	@Column(name = "seat_status",length = 20)
	private SeatStaus status;

	@ApiModelProperty("所属桌子")
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "seat_table_id")
	@JsonIgnoreProperties(value = "seatlist")
	private LibTable belong;
	
	public long getID() {
		return ID;
	}

	public void setID(long iD) {
		ID = iD;
	}

	public String getIndexNum() {
		return IndexNum;
	}

	public void setIndexNum(String indexNum) {
		IndexNum = indexNum;
	}

	public SeatStaus getStatus() {
		return status;
	}

	public void setStatus(SeatStaus status) {
		this.status = status;
	}

	public SeatModel(long iD, String indexNum, SeatStaus status, LibTable belong) {
		super();
		ID = iD;
		IndexNum = indexNum;
		this.status = status;
		this.belong = belong;
	}

	public SeatModel() {
		
	}

	public LibTable getBelong() {
		return belong;
	}

	public void setBelong(LibTable belong) {
		this.belong = belong;
	}

	
}
